/**
 * Created by Administrator on 14-1-6.
 */
(function($) {
    var arkflow = $.arkflow;
    arkflow.PathToPointStrategy = arkflow.PathPointStrategy.extend({
        constructor : function(point) {
            this.base("to", point);
        },
        createPoint:function() {
            return this.paper.rect(this.point.centerNode.x - this.path.attr.toDot.width / 2,
                this.point.centerNode.y - this.path.attr.toDot.height / 2,
                this.path.attr.toDot.width, this.path.attr.toDot.height).attr(this.path.attr.toDot);
        },
        doMoveTo: function(x, y) {
            if (this.point.leftNode && this.point.leftNode.left() && this.point.leftNode.left().type() == "from") {
                this.point.leftNode.left().pos(arkflow.util.connPoint(this.fromEvent.getBBox(), this.point.centerNode));
            }
            if (this.point.leftNode && this.point.leftNode.left()) {
                this.point.leftNode.pos(this.center(this.point.centerNode, this.point.leftNode.left().pos()));
            }
        }
    });
})(jQuery);